package com.rose.doorto.footbathdoor.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.rose.doorto.footbathdoor.pojo.Order;
import com.rose.doorto.footbathdoor.util.PageUtils;
import com.rose.doorto.footbathdoor.vo.AlipayNotifyVO;
import com.rose.doorto.footbathdoor.vo.OrderCreateVO;
import com.rose.doorto.footbathdoor.vo.OrderSubmitVO;
import com.rose.doorto.footbathdoor.vo.OrderVo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lqc
 * @since 2024-07-23
 */
public interface OrderService extends IService<Order> {


    /**
     * 获取当前登录用户的所有订单
     * @return
     */
    List<Order> findAllByUserId(String userId);

    /**
     * 创建订单
     * @param order
     * @return
     */
    int addOrders(Order order);


    int submit(OrderVo orderVo, HttpSession session, String serviceTime);


    /**
     * 提交订单,创建订单
     * @param submitVO
     * @return
     */
    OrderCreateVO submit(OrderSubmitVO submitVO,String serviceTime,HttpSession session);
    /**
     * 根据订单状态获取指定的订单
     * @param status
     * @return
     */
    List<Order> getOrderByStatus(int status,int userId);

    /**
     * 查看订单详情
     * @param orderSn
     * @return
     */
    Order getOrderByOrderSn(String orderSn);


    /**
     * 根据项目名称获取订单列表(模糊查询)
     * @param projectName
     * @return
     */
    List<Order> findOrderByLikeProject(String projectName,String userId);

    /**
     * 查询指定时间范围内的订单
     * @param code
     * @return
     */
    List<Order> getOrderByCreatime(int code,int userId);

    /**
     * 处理支付宝异步通知信息
     * @param notifyVO
     * @param request
     * @return
     */
    String handleAlipayNotify(AlipayNotifyVO notifyVO, HttpServletRequest request);

    /**
     * 分页查询当前登录用户的订单列表
     * @param params
     * @return
     */
    PageUtils getCurrentUserOrderList(Map<String, Object> params,HttpSession session);

    /**
     * 处理订单
     * @param params
     */
    void processOrder(Map<String, String> params);
    /**
     * 分页查询所有订单
     * @param params
     * @return
     */
    PageUtils getOrderList(Map<String, Object> params);

    //修改订单的支付方式
    boolean updateOrderPayType(String orderSn,int payType);
}
